home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_emacs.idb / usr / freeware / info / emacs-2.z / emacs-2
Encoding:
GNU Info File  |  1998-10-28  |  45.8 KB  |  924 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Copying,  Next: Intro,  Prev: Distrib,  Up: Top
  6.  
  7. GNU GENERAL PUBLIC LICENSE
  8. **************************
  9.  
  10.                          Version 2, June 1991
  11.  
  12.      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  13.      675 Mass Ave, Cambridge, MA 02139, USA
  14.      
  15.      Everyone is permitted to copy and distribute verbatim copies
  16.      of this license document, but changing it is not allowed.
  17.  
  18. Preamble
  19. ========
  20.  
  21.    The licenses for most software are designed to take away your
  22. freedom to share and change it.  By contrast, the GNU General Public
  23. License is intended to guarantee your freedom to share and change free
  24. software--to make sure the software is free for all its users.  This
  25. General Public License applies to most of the Free Software
  26. Foundation's software and to any other program whose authors commit to
  27. using it.  (Some other Free Software Foundation software is covered by
  28. the GNU Library General Public License instead.)  You can apply it to
  29. your programs, too.
  30.  
  31.    When we speak of free software, we are referring to freedom, not
  32. price.  Our General Public Licenses are designed to make sure that you
  33. have the freedom to distribute copies of free software (and charge for
  34. this service if you wish), that you receive source code or can get it
  35. if you want it, that you can change the software or use pieces of it in
  36. new free programs; and that you know you can do these things.
  37.  
  38.    To protect your rights, we need to make restrictions that forbid
  39. anyone to deny you these rights or to ask you to surrender the rights.
  40. These restrictions translate to certain responsibilities for you if you
  41. distribute copies of the software, or if you modify it.
  42.  
  43.    For example, if you distribute copies of such a program, whether
  44. gratis or for a fee, you must give the recipients all the rights that
  45. you have.  You must make sure that they, too, receive or can get the
  46. source code.  And you must show them these terms so they know their
  47. rights.
  48.  
  49.    We protect your rights with two steps: (1) copyright the software,
  50. and (2) offer you this license which gives you legal permission to copy,
  51. distribute and/or modify the software.
  52.  
  53.    Also, for each author's protection and ours, we want to make certain
  54. that everyone understands that there is no warranty for this free
  55. software.  If the software is modified by someone else and passed on, we
  56. want its recipients to know that what they have is not the original, so
  57. that any problems introduced by others will not reflect on the original
  58. authors' reputations.
  59.  
  60.    Finally, any free program is threatened constantly by software
  61. patents.  We wish to avoid the danger that redistributors of a free
  62. program will individually obtain patent licenses, in effect making the
  63. program proprietary.  To prevent this, we have made it clear that any
  64. patent must be licensed for everyone's free use or not licensed at all.
  65.  
  66.    The precise terms and conditions for copying, distribution and
  67. modification follow.
  68.  
  69.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  70.  
  71.   0. This License applies to any program or other work which contains a
  72.      notice placed by the copyright holder saying it may be distributed
  73.      under the terms of this General Public License.  The "Program",
  74.      below, refers to any such program or work, and a "work based on
  75.      the Program" means either the Program or any derivative work under
  76.      copyright law: that is to say, a work containing the Program or a
  77.      portion of it, either verbatim or with modifications and/or
  78.      translated into another language.  (Hereinafter, translation is
  79.      included without limitation in the term "modification".)  Each
  80.      licensee is addressed as "you".
  81.  
  82.      Activities other than copying, distribution and modification are
  83.      not covered by this License; they are outside its scope.  The act
  84.      of running the Program is not restricted, and the output from the
  85.      Program is covered only if its contents constitute a work based on
  86.      the Program (independent of having been made by running the
  87.      Program).  Whether that is true depends on what the Program does.
  88.  
  89.   1. You may copy and distribute verbatim copies of the Program's
  90.      source code as you receive it, in any medium, provided that you
  91.      conspicuously and appropriately publish on each copy an appropriate
  92.      copyright notice and disclaimer of warranty; keep intact all the
  93.      notices that refer to this License and to the absence of any
  94.      warranty; and give any other recipients of the Program a copy of
  95.      this License along with the Program.
  96.  
  97.      You may charge a fee for the physical act of transferring a copy,
  98.      and you may at your option offer warranty protection in exchange
  99.      for a fee.
  100.  
  101.   2. You may modify your copy or copies of the Program or any portion
  102.      of it, thus forming a work based on the Program, and copy and
  103.      distribute such modifications or work under the terms of Section 1
  104.      above, provided that you also meet all of these conditions:
  105.  
  106.        a. You must cause the modified files to carry prominent notices
  107.           stating that you changed the files and the date of any change.
  108.  
  109.        b. You must cause any work that you distribute or publish, that
  110.           in whole or in part contains or is derived from the Program
  111.           or any part thereof, to be licensed as a whole at no charge
  112.           to all third parties under the terms of this License.
  113.  
  114.        c. If the modified program normally reads commands interactively
  115.           when run, you must cause it, when started running for such
  116.           interactive use in the most ordinary way, to print or display
  117.           an announcement including an appropriate copyright notice and
  118.           a notice that there is no warranty (or else, saying that you
  119.           provide a warranty) and that users may redistribute the
  120.           program under these conditions, and telling the user how to
  121.           view a copy of this License.  (Exception: if the Program
  122.           itself is interactive but does not normally print such an
  123.           announcement, your work based on the Program is not required
  124.           to print an announcement.)
  125.  
  126.      These requirements apply to the modified work as a whole.  If
  127.      identifiable sections of that work are not derived from the
  128.      Program, and can be reasonably considered independent and separate
  129.      works in themselves, then this License, and its terms, do not
  130.      apply to those sections when you distribute them as separate
  131.      works.  But when you distribute the same sections as part of a
  132.      whole which is a work based on the Program, the distribution of
  133.      the whole must be on the terms of this License, whose permissions
  134.      for other licensees extend to the entire whole, and thus to each
  135.      and every part regardless of who wrote it.
  136.  
  137.      Thus, it is not the intent of this section to claim rights or
  138.      contest your rights to work written entirely by you; rather, the
  139.      intent is to exercise the right to control the distribution of
  140.      derivative or collective works based on the Program.
  141.  
  142.      In addition, mere aggregation of another work not based on the
  143.      Program with the Program (or with a work based on the Program) on
  144.      a volume of a storage or distribution medium does not bring the
  145.      other work under the scope of this License.
  146.  
  147.   3. You may copy and distribute the Program (or a work based on it,
  148.      under Section 2) in object code or executable form under the terms
  149.      of Sections 1 and 2 above provided that you also do one of the
  150.      following:
  151.  
  152.        a. Accompany it with the complete corresponding machine-readable
  153.           source code, which must be distributed under the terms of
  154.           Sections 1 and 2 above on a medium customarily used for
  155.           software interchange; or,
  156.  
  157.        b. Accompany it with a written offer, valid for at least three
  158.           years, to give any third party, for a charge no more than your
  159.           cost of physically performing source distribution, a complete
  160.           machine-readable copy of the corresponding source code, to be
  161.           distributed under the terms of Sections 1 and 2 above on a
  162.           medium customarily used for software interchange; or,
  163.  
  164.        c. Accompany it with the information you received as to the offer
  165.           to distribute corresponding source code.  (This alternative is
  166.           allowed only for noncommercial distribution and only if you
  167.           received the program in object code or executable form with
  168.           such an offer, in accord with Subsection b above.)
  169.  
  170.      The source code for a work means the preferred form of the work for
  171.      making modifications to it.  For an executable work, complete
  172.      source code means all the source code for all modules it contains,
  173.      plus any associated interface definition files, plus the scripts
  174.      used to control compilation and installation of the executable.
  175.      However, as a special exception, the source code distributed need
  176.      not include anything that is normally distributed (in either
  177.      source or binary form) with the major components (compiler,
  178.      kernel, and so on) of the operating system on which the executable
  179.      runs, unless that component itself accompanies the executable.
  180.  
  181.      If distribution of executable or object code is made by offering
  182.      access to copy from a designated place, then offering equivalent
  183.      access to copy the source code from the same place counts as
  184.      distribution of the source code, even though third parties are not
  185.      compelled to copy the source along with the object code.
  186.  
  187.   4. You may not copy, modify, sublicense, or distribute the Program
  188.      except as expressly provided under this License.  Any attempt
  189.      otherwise to copy, modify, sublicense or distribute the Program is
  190.      void, and will automatically terminate your rights under this
  191.      License.  However, parties who have received copies, or rights,
  192.      from you under this License will not have their licenses
  193.      terminated so long as such parties remain in full compliance.
  194.  
  195.   5. You are not required to accept this License, since you have not
  196.      signed it.  However, nothing else grants you permission to modify
  197.      or distribute the Program or its derivative works.  These actions
  198.      are prohibited by law if you do not accept this License.
  199.      Therefore, by modifying or distributing the Program (or any work
  200.      based on the Program), you indicate your acceptance of this
  201.      License to do so, and all its terms and conditions for copying,
  202.      distributing or modifying the Program or works based on it.
  203.  
  204.   6. Each time you redistribute the Program (or any work based on the
  205.      Program), the recipient automatically receives a license from the
  206.      original licensor to copy, distribute or modify the Program
  207.      subject to these terms and conditions.  You may not impose any
  208.      further restrictions on the recipients' exercise of the rights
  209.      granted herein.  You are not responsible for enforcing compliance
  210.      by third parties to this License.
  211.  
  212.   7. If, as a consequence of a court judgment or allegation of patent
  213.      infringement or for any other reason (not limited to patent
  214.      issues), conditions are imposed on you (whether by court order,
  215.      agreement or otherwise) that contradict the conditions of this
  216.      License, they do not excuse you from the conditions of this
  217.      License.  If you cannot distribute so as to satisfy simultaneously
  218.      your obligations under this License and any other pertinent
  219.      obligations, then as a consequence you may not distribute the
  220.      Program at all.  For example, if a patent license would not permit
  221.      royalty-free redistribution of the Program by all those who
  222.      receive copies directly or indirectly through you, then the only
  223.      way you could satisfy both it and this License would be to refrain
  224.      entirely from distribution of the Program.
  225.  
  226.      If any portion of this section is held invalid or unenforceable
  227.      under any particular circumstance, the balance of the section is
  228.      intended to apply and the section as a whole is intended to apply
  229.      in other circumstances.
  230.  
  231.      It is not the purpose of this section to induce you to infringe any
  232.      patents or other property right claims or to contest validity of
  233.      any such claims; this section has the sole purpose of protecting
  234.      the integrity of the free software distribution system, which is
  235.      implemented by public license practices.  Many people have made
  236.      generous contributions to the wide range of software distributed
  237.      through that system in reliance on consistent application of that
  238.      system; it is up to the author/donor to decide if he or she is
  239.      willing to distribute software through any other system and a
  240.      licensee cannot impose that choice.
  241.  
  242.      This section is intended to make thoroughly clear what is believed
  243.      to be a consequence of the rest of this License.
  244.  
  245.   8. If the distribution and/or use of the Program is restricted in
  246.      certain countries either by patents or by copyrighted interfaces,
  247.      the original copyright holder who places the Program under this
  248.      License may add an explicit geographical distribution limitation
  249.      excluding those countries, so that distribution is permitted only
  250.      in or among countries not thus excluded.  In such case, this
  251.      License incorporates the limitation as if written in the body of
  252.      this License.
  253.  
  254.   9. The Free Software Foundation may publish revised and/or new
  255.      versions of the General Public License from time to time.  Such
  256.      new versions will be similar in spirit to the present version, but
  257.      may differ in detail to address new problems or concerns.
  258.  
  259.      Each version is given a distinguishing version number.  If the
  260.      Program specifies a version number of this License which applies
  261.      to it and "any later version", you have the option of following
  262.      the terms and conditions either of that version or of any later
  263.      version published by the Free Software Foundation.  If the Program
  264.      does not specify a version number of this License, you may choose
  265.      any version ever published by the Free Software Foundation.
  266.  
  267.  10. If you wish to incorporate parts of the Program into other free
  268.      programs whose distribution conditions are different, write to the
  269.      author to ask for permission.  For software which is copyrighted
  270.      by the Free Software Foundation, write to the Free Software
  271.      Foundation; we sometimes make exceptions for this.  Our decision
  272.      will be guided by the two goals of preserving the free status of
  273.      all derivatives of our free software and of promoting the sharing
  274.      and reuse of software generally.
  275.  
  276.                                 NO WARRANTY
  277.  
  278.  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  279.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  280.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  281.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  282.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  283.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  284.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  285.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  286.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  287.      SERVICING, REPAIR OR CORRECTION.
  288.  
  289.  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  290.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  291.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  292.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  293.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  294.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  295.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  296.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  297.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  298.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  299.  
  300.                       END OF TERMS AND CONDITIONS
  301.  
  302. How to Apply These Terms to Your New Programs
  303. =============================================
  304.  
  305.    If you develop a new program, and you want it to be of the greatest
  306. possible use to the public, the best way to achieve this is to make it
  307. free software which everyone can redistribute and change under these
  308. terms.
  309.  
  310.    To do so, attach the following notices to the program.  It is safest
  311. to attach them to the start of each source file to most effectively
  312. convey the exclusion of warranty; and each file should have at least
  313. the "copyright" line and a pointer to where the full notice is found.
  314.  
  315.      ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
  316.      Copyright (C) 19YY  NAME OF AUTHOR
  317.      
  318.      This program is free software; you can redistribute it and/or
  319.      modify it under the terms of the GNU General Public License
  320.      as published by the Free Software Foundation; either version 2
  321.      of the License, or (at your option) any later version.
  322.      
  323.      This program is distributed in the hope that it will be useful,
  324.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  325.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  326.      GNU General Public License for more details.
  327.      
  328.      You should have received a copy of the GNU General Public License
  329.      along with this program; if not, write to the Free Software
  330.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  331.  
  332.    Also add information on how to contact you by electronic and paper
  333. mail.
  334.  
  335.    If the program is interactive, make it output a short notice like
  336. this when it starts in an interactive mode:
  337.  
  338.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  339.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  340.      type `show w'.  This is free software, and you are welcome
  341.      to redistribute it under certain conditions; type `show c'
  342.      for details.
  343.  
  344.    The hypothetical commands `show w' and `show c' should show the
  345. appropriate parts of the General Public License.  Of course, the
  346. commands you use may be called something other than `show w' and `show
  347. c'; they could even be mouse-clicks or menu items--whatever suits your
  348. program.
  349.  
  350.    You should also get your employer (if you work as a programmer) or
  351. your school, if any, to sign a "copyright disclaimer" for the program,
  352. if necessary.  Here is a sample; alter the names:
  353.  
  354.      Yoyodyne, Inc., hereby disclaims all copyright
  355.      interest in the program `Gnomovision'
  356.      (which makes passes at compilers) written
  357.      by James Hacker.
  358.      
  359.      SIGNATURE OF TY COON, 1 April 1989
  360.      Ty Coon, President of Vice
  361.  
  362.    This General Public License does not permit incorporating your
  363. program into proprietary programs.  If your program is a subroutine
  364. library, you may consider it more useful to permit linking proprietary
  365. applications with the library.  If this is what you want to do, use the
  366. GNU Library General Public License instead of this License.
  367.  
  368. 
  369. File: emacs,  Node: Intro,  Next: Glossary,  Prev: Copying,  Up: Top
  370.  
  371. Introduction
  372. ************
  373.  
  374.    You are reading about GNU Emacs, the GNU incarnation of the advanced,
  375. self-documenting, customizable, extensible real-time display editor
  376. Emacs.  (The `G' in `GNU' is not silent.)
  377.  
  378.    We say that Emacs is a "display" editor because normally the text
  379. being edited is visible on the screen and is updated automatically as
  380. you type your commands.  *Note Display: Screen.
  381.  
  382.    We call it a "real-time" editor because the display is updated very
  383. frequently, usually after each character or pair of characters you
  384. type.  This minimizes the amount of information you must keep in your
  385. head as you edit.  *Note Real-time: Basic.
  386.  
  387.    We call Emacs advanced because it provides facilities that go beyond
  388. simple insertion and deletion: controlling subprocesses; automatic
  389. indentation of programs; viewing two or more files at once; editing
  390. formatted text; and dealing in terms of characters, words, lines,
  391. sentences, paragraphs, and pages, as well as expressions and comments in
  392. several different programming languages.
  393.  
  394.    "Self-documenting" means that at any time you can type a special
  395. character, `Control-h', to find out what your options are.  You can
  396. also use it to find out what any command does, or to find all the
  397. commands that pertain to a topic.  *Note Help::.
  398.  
  399.    "Customizable" means that you can change the definitions of Emacs
  400. commands in little ways.  For example, if you use a programming
  401. language in which comments start with `<**' and end with `**>', you can
  402. tell the Emacs comment manipulation commands to use those strings
  403. (*note Comments::.).  Another sort of customization is rearrangement of
  404. the command set.  For example, if you prefer the four basic cursor
  405. motion commands (up, down, left and right) on keys in a diamond pattern
  406. on the keyboard, you can rebind the keys that way.  *Note
  407. Customization::.
  408.  
  409.    "Extensible" means that you can go beyond simple customization and
  410. write entirely new commands, programs in the Lisp language to be run by
  411. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible" system,
  412. which means that it is divided into many functions that call each
  413. other, any of which can be redefined in the middle of an editing
  414. session.  Almost any part of Emacs can be replaced without making a
  415. separate copy of all of Emacs.  Most of the editing commands of Emacs
  416. are written in Lisp already; the few exceptions could have been written
  417. in Lisp but are written in C for efficiency.  Although only a programmer
  418. can write an extension, anybody can use it afterward.
  419.  
  420.    When run under the X Window System, Emacs provides its own menus and
  421. convenient bindings to mouse buttons.  But Emacs can provide many of the
  422. benefits of a window system on a text-only terminal.  For instance, you
  423. can look at or edit several files at once, move text between them, and
  424. edit files at the same time as you run shell commands.
  425.  
  426. 
  427. File: emacs,  Node: Screen,  Next: User Input,  Prev: Acknowledgments,  Up: Top
  428.  
  429. The Organization of the Screen
  430. ******************************
  431.  
  432.    On a text-only terminal, the Emacs display occupies the whole screen.
  433. On the X Window System, Emacs creates its own X windows to use.  We use
  434. the term "frame" to mean an entire text-only screen or an entire X
  435. window used by Emacs.  Emacs uses both kinds of frames in the same way
  436. to display your editing.  Emacs normally starts out with just one frame,
  437. but you can create additional frames if you wish.  *Note Frames::.
  438.  
  439.    When you start Emacs, the entire frame except for the last line is
  440. devoted to the text you are editing.  This area is called "window".
  441. The last line is a special "echo area" or "minibuffer window" where
  442. prompts appear and where you can enter responses.  You can subdivide
  443. the large text window horizontally or vertically into multiple text
  444. windows, each of which can be used for a different file (*note
  445. Windows::.).  In this manual, the word "window" always refers to the
  446. subdivisions of a frame within Emacs.
  447.  
  448.    The window that the cursor is in is the "selected window", in which
  449. editing takes place.  Most Emacs commands implicitly apply to the text
  450. in the selected window (though mouse commands generally operate on
  451. whatever window you click them in, whether selected or not).  The other
  452. windows display text for reference only, unless/until you select them.
  453. If you use multiple frames under the X Window System, then giving the
  454. input focus to a particular frame selects a window in that frame.
  455.  
  456.    Each window's last line is a "mode line" which describes what is
  457. going on in that window.  It appears in inverse video if the terminal
  458. supports that, and contains text that starts like `-----Emacs:
  459. SOMETHING'.  Its purpose is to indicate what buffer is being displayed
  460. above it in the window; what major and minor modes are in use; and
  461. whether the buffer contains unsaved changes.
  462.  
  463. * Menu:
  464.  
  465. * Point::    The place in the text where editing commands operate.
  466. * Echo Area::   Short messages appear at the bottom of the screen.
  467. * Mode Line::    Interpreting the mode line.
  468.  
  469. 
  470. File: emacs,  Node: Point,  Next: Echo Area,  Up: Screen
  471.  
  472. Point
  473. =====
  474.  
  475.    Within Emacs, the terminal's cursor shows the location at which
  476. editing commands will take effect.  This location is called "point".
  477. Many Emacs commands move point through the text, so that you can edit at
  478. different places in it.  You can also place point by clicking mouse
  479. button 1.
  480.  
  481.    While the cursor appears to point AT a character, you should think
  482. of point as BETWEEN two characters; it points BEFORE the character that
  483. appears under the cursor.  For example, if your text looks like `frob'
  484. with the cursor over the `b', then point is between the `o' and the
  485. `b'.  If you insert the character `!' at that position, the result is
  486. `fro!b', with point between the `!' and the `b'.  Thus, the cursor
  487. remains over the `b', as before.
  488.  
  489.    Sometimes people speak of "the cursor" when they mean "point", or
  490. speak of commands that move point as "cursor motion" commands.
  491.  
  492.    Terminals have only one cursor, and when output is in progress it
  493. must appear where the typing is being done.  This does not mean that
  494. point is moving.  It is only that Emacs has no way to show you the
  495. location of point except when the terminal is idle.
  496.  
  497.    If you are editing several files in Emacs, each in its own buffer,
  498. each buffer has its own point location.  A buffer that is not currently
  499. displayed remembers where point is in case you display it again later.
  500.  
  501.    When there are multiple windows in a frame, each window has its own
  502. point location.  The cursor shows the location of point in the selected
  503. window.  This also is how you can tell which window is selected.  If the
  504. same buffer appears in more than one window, each window has its own
  505. position for point in that buffer.
  506.  
  507.    When there are multiple frames, each frame can display one cursor.
  508. The cursor in the selected frame is solid; the cursor in other frames is
  509. a hollow box, and appears in the window that would be selected if you
  510. give the input focus to that frame.
  511.  
  512.    The term `point' comes from the character `.', which was the command
  513. in TECO (the language in which the original Emacs was written) for
  514. accessing the value now called `point'.
  515.  
  516. 
  517. File: emacs,  Node: Echo Area,  Next: Mode Line,  Prev: Point,  Up: Screen
  518.  
  519. The Echo Area
  520. =============
  521.  
  522.    The line at the bottom of the frame (below the mode line) is the
  523. "echo area".  It is used to display small amounts of text for several
  524. purposes.
  525.  
  526.    "Echoing" means displaying the characters that you type.  Outside
  527. Emacs, the operating system normally echoes all your input.  Emacs
  528. handles echoing differently.
  529.  
  530.    Single-character commands do not echo in Emacs, and multi-character
  531. commands echo only if you pause while typing them.  As soon as you pause
  532. for more than a second in the middle of a command, Emacs echoes all the
  533. characters of the command so far.  This is to "prompt" you for the rest
  534. of the command.  Once echoing has started, the rest of the command
  535. echoes immediately as you type it.  This behavior is designed to give
  536. confident users fast response, while giving hesitant users maximum
  537. feedback.  You can change this behavior by setting a variable (*note
  538. Display Vars::.).
  539.  
  540.    If a command cannot be executed, it may print an "error message" in
  541. the echo area.  Error messages are accompanied by a beep or by flashing
  542. the screen.  Also, any input you have typed ahead is thrown away when
  543. an error happens.
  544.  
  545.    Some commands print informative messages in the echo area.  These
  546. messages look much like error messages, but they are not announced with
  547. a beep and do not throw away input.  Sometimes the message tells you
  548. what the command has done, when this is not obvious from looking at the
  549. text being edited.  Sometimes the sole purpose of a command is to print
  550. a message giving you specific information--for example, `C-x =' prints
  551. a message describing the character position of point in the text and
  552. its current column in the window.  Commands that take a long time often
  553. display messages ending in `...' while they are working, and add `done'
  554. at the end when they are finished.
  555.  
  556.    Echo area informative messages are saved in an editor buffer named
  557. `*Messages*'.  (We have not explained buffers yet; see *Note Buffers::,
  558. for more information about them.)  If you miss a message that appears
  559. briefly on the screen, you can switch to the `*Messages*' buffer to see
  560. it again.  Successive progress messages are often collapsed into one.
  561.  
  562.    The size of `*Messages*' is limited to a certain number of lines.
  563. The variable `message-log-max' specifies how many lines.  Once the
  564. buffer has that many lines, each line added at the end deletes one line
  565. from the beginning.  *Note Variables::, for how to set variables such as
  566. `message-log-max'.
  567.  
  568.    The echo area is also used to display the "minibuffer", a window that
  569. is used for reading arguments to commands, such as the name of a file
  570. to be edited.  When the minibuffer is in use, the echo area begins with
  571. a prompt string that usually ends with a colon; also, the cursor
  572. appears in that line because it is the selected window.  You can always
  573. get out of the minibuffer by typing `C-g'.  *Note Minibuffer::.
  574.  
  575. 
  576. File: emacs,  Node: Mode Line,  Prev: Echo Area,  Up: Screen
  577.  
  578. The Mode Line
  579. =============
  580.  
  581.    Each text window's last line is a "mode line" which describes what
  582. is going on in that window.  When there is only one text window, the
  583. mode line appears right above the echo area.  The mode line is in
  584. inverse video if the terminal supports that, it starts and ends with
  585. dashes, and it contains text like `Emacs: SOMETHING'.
  586.  
  587.    A few special editing modes, such as Dired and Rmail, display
  588. something else in place of `Emacs: SOMETHING'.  The rest of the mode
  589. line still has the usual meaning.
  590.  
  591.    Normally, the mode line looks like this:
  592.  
  593.      --CH-Emacs: BUF      (MAJOR MINOR)--LINE--POS------
  594.  
  595. This gives information about the buffer being displayed in the window:
  596. the buffer's name, what major and minor modes are in use, whether the
  597. buffer's text has been changed, and how far down the buffer you are
  598. currently looking.
  599.  
  600.    CH contains two stars `**' if the text in the buffer has been edited
  601. (the buffer is "modified"), or `--' if the buffer has not been edited.
  602. For a read-only buffer, it is `%*' if the buffer is modified, and `%%'
  603. otherwise.
  604.  
  605.    BUF is the name of the window's "buffer".  In most cases this is the
  606. same as the name of a file you are editing.  *Note Buffers::.
  607.  
  608.    The buffer displayed in the selected window (the window that the
  609. cursor is in) is also Emacs's selected buffer, the one that editing
  610. takes place in.  When we speak of what some command does to "the
  611. buffer", we are talking about the currently selected buffer.
  612.  
  613.    LINE is `L' followed by the current line number of point.  This is
  614. present when Line Number mode is enabled (which it normally is).  You
  615. can optionally display the current column number too, by turning on
  616. Column Number mode (which is not enabled by default because it is
  617. somewhat slower).  *Note Optional Mode Line::.
  618.  
  619.    POS tells you whether there is additional text above the top of the
  620. window, or below the bottom.  If your buffer is small and it is all
  621. visible in the window, POS is `All'.  Otherwise, it is `Top' if you are
  622. looking at the beginning of the buffer, `Bot' if you are looking at the
  623. end of the buffer, or `NN%', where NN is the percentage of the buffer
  624. above the top of the window.
  625.  
  626.    MAJOR is the name of the "major mode" in effect in the buffer.  At
  627. any time, each buffer is in one and only one of the possible major
  628. modes.  The major modes available include Fundamental mode (the least
  629. specialized), Text mode, Lisp mode, C mode, Texinfo mode, and many
  630. others.  *Note Major Modes::, for details of how the modes differ and
  631. how to select one.
  632.  
  633.    Some major modes display additional information after the major mode
  634. name.  For example, Rmail buffers display the current message number and
  635. the total number of messages.  Compilation buffers and Shell buffers
  636. display the status of the subprocess.
  637.  
  638.    MINOR is a list of some of the "minor modes" that are turned on at
  639. the moment in the window's chosen buffer.  For example, `Fill' means
  640. that Auto Fill mode is on.  `Abbrev' means that Word Abbrev mode is on.
  641. `Ovwrt' means that Overwrite mode is on.  *Note Minor Modes::, for
  642. more information.  `Narrow' means that the buffer being displayed has
  643. editing restricted to only a portion of its text.  This is not really a
  644. minor mode, but is like one.  *Note Narrowing::.  `Def' means that a
  645. keyboard macro is being defined.  *Note Keyboard Macros::.
  646.  
  647.    In addition, if Emacs is currently inside a recursive editing level,
  648. square brackets (`[...]') appear around the parentheses that surround
  649. the modes.  If Emacs is in one recursive editing level within another,
  650. double square brackets appear, and so on.  Since recursive editing
  651. levels affect Emacs globally, not just one buffer, the square brackets
  652. appear in every window's mode line or not in any of them.  *Note
  653. Recursive Edit::.
  654.  
  655.    *Note Optional Mode Line::, for features that add other handy
  656. information to the mode line, such as the current line number of point,
  657. the current time, and whether new mail for you has arrived.
  658.  
  659. 
  660. File: emacs,  Node: User Input,  Next: Keys,  Prev: Screen,  Up: Top
  661.  
  662. Kinds of User Input
  663. ===================
  664.  
  665.    GNU Emacs uses an extension of the ASCII character set for keyboard
  666. input; it also accepts non-character input events including function
  667. keys and mouse button actions.
  668.  
  669.    ASCII consists of 128 character codes.  Some of these codes are
  670. assigned graphic symbols such as `a' and `='; the rest are control
  671. characters, such as `Control-a' (usually written `C-a' for short).
  672. `C-a' gets its name from the fact that you type it by holding down the
  673. CTRL key while pressing `a'.
  674.  
  675.    Some control characters have special names, and special keys you can
  676. type them with: for example, RET, TAB, LFD, DEL and ESC.  The space
  677. character is usually referred to below as SPC, even though strictly
  678. speaking it is a graphic character whose graphic happens to be blank.
  679.  
  680.    On ASCII terminals, there are only 32 possible control characters.
  681. These are the control variants of letters and `@[]\^_'.  In addition,
  682. the shift key is meaningless with control characters: `C-a' and `C-A'
  683. are the same character, and Emacs cannot distinguish them.
  684.  
  685.    But the Emacs character set has room for control variants of all
  686. characters, and for distinguishing between `C-a' and `C-A'.  X Windows
  687. makes it possible to enter all these characters.  For example, `C--'
  688. (that's Control-Minus) and `C-5' are meaningful Emacs commands under X.
  689.  
  690.    Another Emacs character set extension is that characters have
  691. additional modifier bits.  Only one modifier bit is commonly used; it is
  692. called Meta.  Every character has a Meta variant; examples include
  693. `Meta-a' (normally written `M-a', for short), `M-A' (not the same
  694. character as `M-a', but those two characters normally have the same
  695. meaning in Emacs), `M-RET', and `M-C-a'.  For reasons of tradition, we
  696. usually write `C-M-a' rather than `M-C-a'; logically speaking, the
  697. order in which the modifier keys CTRL and META are mentioned does not
  698. matter.
  699.  
  700.    Some terminals have a META key, and allow you to type Meta
  701. characters by holding this key down.  Thus, `Meta-a' is typed by
  702. holding down META and pressing `a'.  The META key works much like the
  703. SHIFT key.  Such a key is not always labeled META, however, as this
  704. function is often a special option for a key with some other primary
  705. purpose.
  706.  
  707.    If there is no META key, you can still type Meta characters using
  708. two-character sequences starting with ESC.  Thus, to enter `M-a', you
  709. could type `ESC a'.  To enter `C-M-a', you would type `ESC C-a'.  ESC
  710. is allowed on terminals with META keys, too, in case you have formed a
  711. habit of using it.
  712.  
  713.    X Windows provides several other modifier keys that can be applied to
  714. any input character.  These are called SUPER, HYPER and ALT.  We write
  715. `s-', `H-' and `A-' to say that a character uses these modifiers.
  716. Thus, `s-H-C-x' is short for `Super-Hyper-Control-x'.  Not all X
  717. terminals actually provide keys for these modifier flags--in fact, many
  718. terminals have a key labeled ALT which is really a META key.  The
  719. standard key bindings of Emacs do not include any characters with these
  720. modifiers.  But you can assign them meanings of your own by customizing
  721. Emacs.
  722.  
  723.    Keyboard input includes keyboard keys that are not characters at all:
  724. for example function keys and arrow keys.  Mouse buttons are also
  725. outside the gamut of characters.  You can modify these events with the
  726. modifier keys CONTROL, META, SUPER, HYPER and ALT like keyboard
  727. characters.
  728.  
  729.    Input characters and non-character inputs are collectively called
  730. "input events".  *Note Input Events: (elisp)Input Events, for more
  731. information.  If you are not doing Lisp programming, but simply want to
  732. redefine the meaning of some characters or non-character events, see
  733. *Note Customization::.
  734.  
  735.    ASCII terminals cannot really send anything to the computer except
  736. ASCII characters.  These terminals use a sequence of characters to
  737. represent each function key.  But that is invisible to the Emacs user,
  738. because the keyboard input routines recognize these special sequences
  739. and convert them to function key events before any other part of Emacs
  740. gets to see them.
  741.  
  742. 
  743. File: emacs,  Node: Keys,  Next: Commands,  Prev: User Input,  Up: Top
  744.  
  745. Keys
  746. ====
  747.  
  748.    A "key sequence" ("key", for short) is a sequence of input events
  749. that are meaningful as a unit--as "a single command." Some Emacs
  750. command sequences are just one character or one event; for example,
  751. just `C-f' is enough to move forward one character.  But Emacs also has
  752. commands that take two or more events to invoke.
  753.  
  754.    If a sequence of events is enough to invoke a command, it is a
  755. "complete key".  Examples of complete keys include `C-a', `X', RET,
  756. NEXT (a function key), DOWN (an arrow key), `C-x C-f' and `C-x 4 C-f'.
  757. If it isn't long enough to be complete, we call it a "prefix key".  The
  758. above examples show that `C-x' and `C-x 4' are prefix keys.  Every key
  759. sequence is either a complete key or a prefix key.
  760.  
  761.    Most single characters constitute complete keys in the standard Emacs
  762. command bindings.  A few of them are prefix keys.  A prefix key combines
  763. with the following input event to make a longer key sequence, which may
  764. itself be complete or a prefix.  For example, `C-x' is a prefix key, so
  765. `C-x' and the next input event combine to make a two-character key
  766. sequence.  Most of these key sequences are complete keys, including
  767. `C-x C-f' and `C-x b'.  A few, such as `C-x 4' and `C-x r', are
  768. themselves prefix keys that lead to three-character key sequences.
  769. There's no limit to the length of a key sequence, but in practice
  770. people rarely use sequences longer than four events.
  771.  
  772.    By contrast, you can't add more events onto a complete key.  For
  773. example, the two-character sequence `C-f C-k' is not a key, because the
  774. `C-f' is a complete key in itself.  It's impossible to give `C-f C-k'
  775. an independent meaning as a command.  `C-f C-k' is two key sequences,
  776. not one.
  777.  
  778.    All told, the prefix keys in Emacs are `C-c', `C-h', `C-x', `C-x
  779. C-a', `C-x n', `C-x r', `C-x v', `C-x 4', `C-x 5', `C-x 6', and ESC.
  780. But this is not cast in concrete; it is just a matter of Emacs's
  781. standard key bindings.  If you customize Emacs, you can make new prefix
  782. keys, or eliminate these.  *Note Key Bindings::.
  783.  
  784.    If you do make or eliminate prefix keys, that changes the set of
  785. possible key sequences.  For example, if you redefine `C-f' as a
  786. prefix, `C-f C-k' automatically becomes a key (complete, unless you
  787. define it too as a prefix).  Conversely, if you remove the prefix
  788. definition of `C-x 4', then `C-x 4 f' (or `C-x 4 ANYTHING') is no
  789. longer a key.
  790.  
  791.    Typing the help character (`C-h' or F1) after a prefix character
  792. displays a list of the commands starting with that prefix.  There are a
  793. few prefix characters for which `C-h' does not work--for historical
  794. reasons, they have other meanings for `C-h' which are not easy to
  795. change.  But F1 should work for all prefix characters.
  796.  
  797. 
  798. File: emacs,  Node: Commands,  Next: Text Characters,  Prev: Keys,  Up: Top
  799.  
  800. Keys and Commands
  801. =================
  802.  
  803.    This manual is full of passages that tell you what particular keys
  804. do.  But Emacs does not assign meanings to keys directly.  Instead,
  805. Emacs assigns meanings to named "commands", and then gives keys their
  806. meanings by "binding" them to commands.
  807.  
  808.    Every command has a name chosen by a programmer.  The name is usually
  809. made of a few English words separated by dashes; for example,
  810. `next-line' or `forward-word'.  A command also has a "function
  811. definition" which is a Lisp program; this is what makes the command do
  812. what it does.  In Emacs Lisp, a command is actually a special kind of
  813. Lisp function; one which specifies how to read arguments for it and
  814. call it interactively.  For more information on commands and functions,
  815. see *Note What Is a Function: (elisp)What Is a Function.  (The
  816. definition we use in this manual is simplified slightly.)
  817.  
  818.    The bindings between keys and commands are recorded in various tables
  819. called "keymaps".  *Note Keymaps::.
  820.  
  821.    When we say that "`C-n' moves down vertically one line" we are
  822. glossing over a distinction that is irrelevant in ordinary use but is
  823. vital in understanding how to customize Emacs.  It is the command
  824. `next-line' that is programmed to move down vertically.  `C-n' has this
  825. effect *because* it is bound to that command.  If you rebind `C-n' to
  826. the command `forward-word' then `C-n' will move forward by words
  827. instead.  Rebinding keys is a common method of customization.
  828.  
  829.    In the rest of this manual, we usually ignore this subtlety to keep
  830. things simple.  To give the information needed for customization, we
  831. state the name of the command which really does the work in parentheses
  832. after mentioning the key that runs it.  For example, we will say that
  833. "The command `C-n' (`next-line') moves point vertically down," meaning
  834. that `next-line' is a command that moves vertically down and `C-n' is a
  835. key that is standardly bound to it.
  836.  
  837.    While we are on the subject of information for customization only,
  838. it's a good time to tell you about "variables".  Often the description
  839. of a command will say, "To change this, set the variable `mumble-foo'."
  840. A variable is a name used to remember a value.  Most of the variables
  841. documented in this manual exist just to facilitate customization: some
  842. command or other part of Emacs examines the variable and behaves
  843. differently according to the value that you set.  Until you are
  844. interested in customizing, you can ignore the information about
  845. variables.  When you are ready to be interested, read the basic
  846. information on variables, and then the information on individual
  847. variables will make sense.  *Note Variables::.
  848.  
  849. 
  850. File: emacs,  Node: Text Characters,  Next: Entering Emacs,  Prev: Commands,  Up: Top
  851.  
  852. Character Set for Text
  853. ======================
  854.  
  855.    Emacs buffers use an 8-bit character set, because bytes have 8 bits.
  856. ASCII graphic characters in Emacs buffers are displayed with their
  857. graphics.  The newline character (which has the same character code as
  858. LFD) is displayed by starting a new line.  The tab character is
  859. displayed by moving to the next tab stop column (normally every 8
  860. columns).  Other control characters are displayed as a caret (`^')
  861. followed by the non-control version of the character; thus, `C-a' is
  862. displayed as `^A'.  Non-ASCII characters 128 and up are displayed with
  863. octal escape sequences; thus, character code 243 (octal) is displayed
  864. as `\243'.
  865.  
  866.    You can customize the display of these character codes (or ASCII
  867. characters) by creating a "display table".  *Note Display Tables:
  868. (elisp)Display Tables.  This is useful for editing files that use 8-bit
  869. European character sets.  *Note European Display::.
  870.  
  871. 
  872. File: emacs,  Node: Entering Emacs,  Next: Exiting,  Prev: Text Characters,  Up: Top
  873.  
  874. Entering and Exiting Emacs
  875. **************************
  876.  
  877.    The usual way to invoke Emacs is with the shell command `emacs'.
  878. Emacs clears the screen and then displays an initial help message and
  879. copyright notice.  Some operating systems discard all type-ahead when
  880. Emacs starts up; they give Emacs no way to prevent this.  Therefore, it
  881. is advisable to wait until Emacs clears the screen before typing your
  882. first editing command.
  883.  
  884.    If you run Emacs from a shell window under the X Window System, run
  885. it in the background with `emacs&'.  This way, Emacs does not tie up
  886. the shell window, so you can use that to run other shell commands while
  887. Emacs operates its own X windows.  You can begin typing Emacs commands
  888. as soon as you direct your keyboard input to the Emacs frame.
  889.  
  890.    When Emacs starts up, it makes a buffer named `*scratch*'.  That's
  891. the buffer you start out in.  The `*scratch*' buffer uses Lisp
  892. Interaction mode; you can use it to type Lisp expressions and evaluate
  893. them, or you can ignore that capability and simply doodle.  (You can
  894. specify a different major mode for this buffer by setting the variable
  895. `initial-major-mode' in your init file.  *Note Init File::.)
  896.  
  897.    It is possible to specify files to be visited, Lisp files to be
  898. loaded, and functions to be called, by giving Emacs arguments in the
  899. shell command line.  *Note Command Arguments::.  But we don't recommend
  900. doing this.  The feature exists mainly for compatibility with other
  901. editors.
  902.  
  903.    Many other editors are designed to be started afresh each time you
  904. want to edit.  You edit one file and then exit the editor.  The next
  905. time you want to edit either another file or the same one, you must run
  906. the editor again.  With these editors, it makes sense to use a command
  907. line argument to say which file to edit.
  908.  
  909.    But starting a new Emacs each time you want to edit a different file
  910. does not make sense.  For one thing, this would be annoyingly slow.  For
  911. another, this would fail to take advantage of Emacs's ability to visit
  912. more than one file in a single editing session.  And it would lose the
  913. other accumulated context, such as registers, undo history, and the mark
  914. ring.
  915.  
  916.    The recommended way to use GNU Emacs is to start it only once, just
  917. after you log in, and do all your editing in the same Emacs session.
  918. Each time you want to edit a different file, you visit it with the
  919. existing Emacs, which eventually comes to have many files in it ready
  920. for editing.  Usually you do not kill the Emacs until you are about to
  921. log out.  *Note Files::, for more information on visiting more than one
  922. file.
  923.  
  924.